import request from "../request";

export const login = (data, loginMethodBoolean) => {
    if (loginMethodBoolean) {
        return request(`/user/accountPasswordLogin`, 'POST', data)
    }
    return request(`/user/phoneAuthCodeLogin`, 'POST', data)
}

export const logout = () => {
    return request(`/user/logout`, 'GET')
}

export const getTotalConsumption = () => {
    return request(`/user/getTotalConsumption`, 'GET')
}

export const register = (data) => {
    return request(`/user/register`, "POST", data)
}

/**
 *
 * @param data 手机号
 * @returns {Promise<unknown> | *}
 */
export const getAuthCode = (data) => {
    return request(`/user/getAuthCode`, "POST", data)
}